<template>
	<view class='content'>
		<view class="message-box">
			<view class="message-item">
				<view class="flex">
					<view class='msgtitle'>维修时间：{{ detail.ctime}}</view>
					
				</view>
				<view class="flex">
					<view class="money">
						<view class="">
							设备编号：{{ detail.macno}}
						</view>
						<view class="">
							维修记录：{{ detail.content}}
						</view>
						
					</view>
					
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: '',
				detail: {}
			}
		},
		onLoad(option){
			this.id = option.id
			this.getdetail()
		},
		methods: {
			getdetail(){
				var _this = this
				uni.request({
					url: 'http://www.yndzfl.cn/wxsite/Staff/repairDetail',
					method: 'POST',
					header:{
						"Content-Type" : "application/x-www-form-urlencoded"
					},
					data: {
						token: uni.getStorageSync('token'),
						id: _this.id
					},
					success(res) {
						console.log(res)
						if(res.data.code == 1){
							_this.detail = res.data.data
							
						}else if(res.data.code == -1){
							uni.showToast({
								title: res.data.msg,
								icon: 'none'
							})
						}else if(res.data.code == 408){
							uni.showToast({
								title: res.data.msg,
								icon: 'none'
							})
							uni.reLaunch({
								url: '/pages/admin/login'
							})
						}	
						
					}
				})
			}
		}
	}
</script>

<style scoped>
.message-box{
	/* width: 100%; */
	min-height: 100%;
	padding: 28rpx;
}
.message-item{
	background-color: #fff;
	border-radius: 1rpx;
	padding: 20rpx 24rpx;
	margin-bottom: 27rpx;
}
.flex{
	display: flex;
	justify-content: space-between;
	align-items: center;
	line-height: 30px;
}
.msgtitle{
	font-weight: 600;
	font-size: 15px;
}
.money{
	color: #999;
}
.status{
	font-size: 25px;
}
.btns{
	padding: 10px;
	overflow: hidden;
}
.btn{
	width: 100px;
	float: right;
}
</style>
